﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PACKETPARSERMAX20.CORE.UPDATEFIELDS;

namespace PACKETPARSERMAX20.CORE
{
    public class WoWObjectGameObject : WoWObjectBase
    {
        public WoWObjectGameObject(WoWCore sender, UInt64 guid, TypeID pTypeID)
            : base(sender, guid, pTypeID)
        {

        }

        public override string Name
        {
            get
            {
                if (base.Name == null)
                {
                    if (Fields == null) { return base.Name; }
                    base.Name = GlobalCache.GetGameObjectName(base.ENTRY);
                }

                return base.Name;
            }
             
            internal set
            {
                base.Name = value;
            }
        }

        public override float X
        {
            get
            {
                return movementInfo.positionInfo_0x100_2.X;
            }
            set
            {
                movementInfo.positionInfo_0x100_2.X = value;
            }
        }

        public override float Y
        {
            get
            {
                return movementInfo.positionInfo_0x100_2.Y;
            }
            set
            {
                movementInfo.positionInfo_0x100_2.Y = value;
            }
        }

        public override float Z
        {
            get
            {
                return movementInfo.positionInfo_0x100_2.Z;
            }
            set
            {
                movementInfo.positionInfo_0x100_2.Z = value;
            }
        }

        public override float O
        {
            get
            {
                return movementInfo.positionInfo_0x100_2.O;
            }
            set
            {
                movementInfo.positionInfo_0x100_2.O = value;
            }
        }

        public override void UpdateObjectPosition(float px, float py, float pz, float po, uint time)
        {
            X = px;
            Y = py;
            Z = pz;
            O = po;
            //movementList.Add(time, new Coord4(X, Y, Z, O));
        }
 
    }
}
